<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.3"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>FabGL: SSD1306_OLED/128x64/CollisionDetection/CollisionDetection.ino</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">FabGL
   </div>
   <div id="projectbrief">ESP32 Display Controller and Graphics Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.3 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('_s_s_d1306__o_l_e_d_2128x64_2_collision_detection_2_collision_detection_8ino-example.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle"><div class="title">SSD1306_OLED/128x64/CollisionDetection/CollisionDetection.ino</div></div>
</div><!--header-->
<div class="contents">
<p ><a class="el" href="classfabgl_1_1_scene.html" title="Scene is an abstract class useful to encapsulate functionalities of a scene (sprites,...">fabgl::Scene</a>, sprites and collision detection example</p>
<div class="fragment"><div class="line"><span class="comment">/*</span></div>
<div class="line"><span class="comment">  Created by Fabrizio Di Vittorio (fdivitto2013@gmail.com) - &lt;http://www.fabgl.com&gt;</span></div>
<div class="line"><span class="comment">  Copyright (c) 2019-2022 Fabrizio Di Vittorio.</span></div>
<div class="line"><span class="comment">  All rights reserved.</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">* Please contact fdivitto2013@gmail.com if you need a commercial license.</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">* This library and related software is available under GPL v3.</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">  FabGL is free software: you can redistribute it and/or modify</span></div>
<div class="line"><span class="comment">  it under the terms of the GNU General Public License as published by</span></div>
<div class="line"><span class="comment">  the Free Software Foundation, either version 3 of the License, or</span></div>
<div class="line"><span class="comment">  (at your option) any later version.</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">  FabGL is distributed in the hope that it will be useful,</span></div>
<div class="line"><span class="comment">  but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
<div class="line"><span class="comment">  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
<div class="line"><span class="comment">  GNU General Public License for more details.</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">  You should have received a copy of the GNU General Public License</span></div>
<div class="line"><span class="comment">  along with FabGL.  If not, see &lt;http://www.gnu.org/licenses/&gt;.</span></div>
<div class="line"><span class="comment"> */</span></div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><span class="comment">/*</span></div>
<div class="line"><span class="comment"> * OLED - SDA =&gt; GPIO 4</span></div>
<div class="line"><span class="comment"> * OLED - SCL =&gt; GPIO 15</span></div>
<div class="line"><span class="comment"> */</span></div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &quot;<a class="code" href="fabgl_8h.html">fabgl.h</a>&quot;</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &quot;bitmaps.h&quot;</span></div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#define OLED_SDA       GPIO_NUM_4</span></div>
<div class="line"><span class="preprocessor">#define OLED_SCL       GPIO_NUM_15</span></div>
<div class="line"><span class="preprocessor">#define OLED_ADDR      0x3C</span></div>
<div class="line"> </div>
<div class="line"><span class="comment">// if your display hasn&#39;t RESET set to GPIO_UNUSED</span></div>
<div class="line"><span class="preprocessor">#define OLED_RESET     GPIO_UNUSED  </span><span class="comment">// ie Heltec has GPIO_NUM_16 for reset</span></div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><a id="_a0" name="_a0"></a><a class="code hl_class" href="classfabgl_1_1_i2_c.html">fabgl::I2C</a>               <a class="code hl_enumvalue" href="group___enumerations_ga1e46218ee302fcc8c77e4ea0968ea149.html#gga1e46218ee302fcc8c77e4ea0968ea149afb87bf1fc88386ca21395991f90fff95">I2C</a>;</div>
<div class="line"><a id="_a1" name="_a1"></a><a class="code hl_class" href="classfabgl_1_1_s_s_d1306_controller.html">fabgl::SSD1306Controller</a> DisplayController;</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#define SPACESHIP_COUNT  4</span></div>
<div class="line"><span class="preprocessor">#define ASTEROID_COUNT   2</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#define OBJECTS_COUNT (SPACESHIP_COUNT + ASTEROID_COUNT + 1)    </span><span class="comment">// +1 = is for jupiter!</span></div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><span class="keyword">struct </span>MySprite : Sprite {</div>
<div class="line">  <span class="keywordtype">int</span>  velX;</div>
<div class="line">  <span class="keywordtype">int</span>  velY;</div>
<div class="line">  <span class="keywordtype">bool</span> isAlive;</div>
<div class="line">  <span class="keywordtype">bool</span> isAsteroid;</div>
<div class="line">};</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><span class="keyword">struct </span>MyScene : <span class="keyword">public</span> Scene {</div>
<div class="line"> </div>
<div class="line">  MySprite objects_[OBJECTS_COUNT];</div>
<div class="line"> </div>
<div class="line">  MyScene()</div>
<div class="line">    : Scene(OBJECTS_COUNT, 20, DisplayController.getViewPortWidth(), DisplayController.getViewPortHeight())</div>
<div class="line">  {</div>
<div class="line">  }</div>
<div class="line"> </div>
<div class="line">  <span class="keywordtype">void</span> startSprite(MySprite * sprite)</div>
<div class="line">  {</div>
<div class="line">    <span class="comment">// set initial position to one of the four sides of the screen</span></div>
<div class="line">    <span class="keywordtype">int</span> q = random(4);  <span class="comment">// select beginning screen side</span></div>
<div class="line">    <span class="keywordtype">int</span> x = (q == 0 ? random(getWidth()) : (q == 1 ? getWidth() - sprite-&gt;getWidth() : (q == 2 ? random(getWidth())                : 0)));</div>
<div class="line">    <span class="keywordtype">int</span> y = (q == 0 ? 0                  : (q == 1 ? random(getHeight())             : (q == 2 ? getHeight() - sprite-&gt;getHeight() : random(getHeight()))));</div>
<div class="line">    sprite-&gt;moveTo(x, y);</div>
<div class="line">    sprite-&gt;visible = <span class="keyword">true</span>;</div>
<div class="line">    sprite-&gt;velX    = - sprite-&gt;getWidth() / 4  + random(sprite-&gt;getWidth() / 2);</div>
<div class="line">    sprite-&gt;velY    = - sprite-&gt;getHeight() / 4 + random(sprite-&gt;getHeight() / 2);</div>
<div class="line">    sprite-&gt;isAlive = <span class="keyword">true</span>;</div>
<div class="line">  }</div>
<div class="line"> </div>
<div class="line">  <span class="keywordtype">void</span> init()</div>
<div class="line">  {</div>
<div class="line">    paintSpace();</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// setup spaceship and asteroid sprites</span></div>
<div class="line">    <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; OBJECTS_COUNT; ++i) {</div>
<div class="line">      MySprite * sprite = &amp;objects_[i];</div>
<div class="line">      <span class="keywordflow">if</span> (i == 0) {</div>
<div class="line">        <span class="comment">// setup Jupiter sprite</span></div>
<div class="line">        sprite-&gt;addBitmap(&amp;jupiter);</div>
<div class="line">        sprite-&gt;moveTo(0, getHeight() / 2);</div>
<div class="line">      } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (i &lt;= SPACESHIP_COUNT) {</div>
<div class="line">        <span class="comment">// each spaceship sprite of type Ship has 9 bitmaps: one &quot;spaceship&quot; bitmap and eight &quot;explosion[]&quot; bitmaps</span></div>
<div class="line">        sprite-&gt;addBitmap(&amp;spaceship)-&gt;addBitmap(explosion, 8);</div>
<div class="line">        sprite-&gt;isAsteroid = <span class="keyword">false</span>;</div>
<div class="line">        addSprite(sprite); <span class="comment">// add sprite to collision detector</span></div>
<div class="line">        startSprite(sprite);</div>
<div class="line">      } <span class="keywordflow">else</span> {</div>
<div class="line">        <span class="comment">// each spaceship sprite of type Asteroid has just one bitmap: &quot;asteroid&quot;</span></div>
<div class="line">        sprite-&gt;addBitmap(&amp;asteroid);</div>
<div class="line">        sprite-&gt;isAsteroid = <span class="keyword">true</span>;</div>
<div class="line">        addSprite(sprite); <span class="comment">// add sprite to collision detector</span></div>
<div class="line">        startSprite(sprite);</div>
<div class="line">      }</div>
<div class="line">    }</div>
<div class="line"> </div>
<div class="line">    DisplayController.<a id="a2" name="a2"></a><a class="code hl_function" href="classfabgl_1_1_bitmapped_display_controller_a75ba732cc6ae90f53757b588f6c75d7e.html#a75ba732cc6ae90f53757b588f6c75d7e">setSprites</a>(objects_, OBJECTS_COUNT);</div>
<div class="line">  }</div>
<div class="line"> </div>
<div class="line">  <span class="keywordtype">void</span> update(<span class="keywordtype">int</span> updateCount)</div>
<div class="line">  {</div>
<div class="line">    <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 1; i &lt; OBJECTS_COUNT; ++i) {</div>
<div class="line"> </div>
<div class="line">      MySprite * sprite = &amp;objects_[i];</div>
<div class="line"> </div>
<div class="line">      <span class="comment">// just alive objects can be moved or checked for collisions</span></div>
<div class="line">      <span class="keywordflow">if</span> (sprite-&gt;isAlive) {</div>
<div class="line"> </div>
<div class="line">        <span class="comment">// this object is alive, move to the next position</span></div>
<div class="line">        sprite-&gt;moveBy(sprite-&gt;velX, sprite-&gt;velY, DisplayController.<a id="a3" name="a3"></a><a class="code hl_function" href="classfabgl_1_1_base_display_controller_a69dd55b31e9c284aeec6f2b91a8da525.html#a69dd55b31e9c284aeec6f2b91a8da525">getViewPortWidth</a>(), DisplayController.<a id="a4" name="a4"></a><a class="code hl_function" href="classfabgl_1_1_base_display_controller_a5308b6853d3778845649f08832e96535.html#a5308b6853d3778845649f08832e96535">getViewPortHeight</a>());</div>
<div class="line"> </div>
<div class="line">        <span class="comment">// update the collision detector and check for a possible collision</span></div>
<div class="line">        updateSpriteAndDetectCollisions(sprite);</div>
<div class="line"> </div>
<div class="line">      } <span class="keywordflow">else</span> <span class="keywordflow">if</span> ((updateCount % 8) == 0) {</div>
<div class="line"> </div>
<div class="line">        <span class="comment">// this sprite is dead, go to next frame (animate explosion) every 8 updates</span></div>
<div class="line">        sprite-&gt;nextFrame();</div>
<div class="line">        <span class="keywordflow">if</span> (sprite-&gt;currentFrame == 0)</div>
<div class="line">          startSprite(sprite);  <span class="comment">// explosion animation ended, live again</span></div>
<div class="line"> </div>
<div class="line">      }</div>
<div class="line">    }</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// move Jupiter every 20 updates</span></div>
<div class="line">    <span class="keywordflow">if</span> ((updateCount % 20) == 0)</div>
<div class="line">      objects_[0].moveBy(1, 0, DisplayController.<a class="code hl_function" href="classfabgl_1_1_base_display_controller_a69dd55b31e9c284aeec6f2b91a8da525.html#a69dd55b31e9c284aeec6f2b91a8da525">getViewPortWidth</a>(), DisplayController.<a class="code hl_function" href="classfabgl_1_1_base_display_controller_a5308b6853d3778845649f08832e96535.html#a5308b6853d3778845649f08832e96535">getViewPortHeight</a>());</div>
<div class="line"> </div>
<div class="line">    DisplayController.<a id="a5" name="a5"></a><a class="code hl_function" href="classfabgl_1_1_bitmapped_display_controller_aeb689cfc2364a4d66e3ac3368146c70d.html#aeb689cfc2364a4d66e3ac3368146c70d">refreshSprites</a>();</div>
<div class="line">  }</div>
<div class="line"> </div>
<div class="line">  <span class="keywordtype">void</span> collisionDetected(Sprite * spriteA, Sprite * spriteB, Point collisionPoint)</div>
<div class="line">  {</div>
<div class="line">    MySprite * a = (MySprite*) spriteA;</div>
<div class="line">    MySprite * b = (MySprite*) spriteB;</div>
<div class="line">    <span class="comment">// two asteroids cannot colide</span></div>
<div class="line">    <span class="keywordflow">if</span> (a-&gt;isAsteroid &amp;&amp; b-&gt;isAsteroid)</div>
<div class="line">      <span class="keywordflow">return</span>;</div>
<div class="line">    <span class="comment">// collision ok, mark both objects as dead</span></div>
<div class="line">    a-&gt;isAlive = b-&gt;isAlive = <span class="keyword">false</span>;</div>
<div class="line">    <span class="comment">// if collided object is an asteroid no explosion is shown, just hide it. Otherwise go to next frame.</span></div>
<div class="line">    <span class="keywordflow">if</span> (a-&gt;isAsteroid)</div>
<div class="line">      a-&gt;visible = <span class="keyword">false</span>;</div>
<div class="line">    <span class="keywordflow">else</span></div>
<div class="line">      a-&gt;nextFrame();</div>
<div class="line">    <span class="keywordflow">if</span> (b-&gt;isAsteroid)</div>
<div class="line">      b-&gt;visible = <span class="keyword">false</span>;</div>
<div class="line">    <span class="keywordflow">else</span></div>
<div class="line">      b-&gt;nextFrame();</div>
<div class="line">  }</div>
<div class="line"> </div>
<div class="line">  <span class="keywordtype">void</span> paintSpace()</div>
<div class="line">  {</div>
<div class="line">    Canvas cv(&amp;DisplayController);</div>
<div class="line">    cv.setBrushColor(<a id="a6" name="a6"></a><a class="code hl_enumvalue" href="group___enumerations_gab87bacfdad76e61b9412d7124be44c1c.html#ggab87bacfdad76e61b9412d7124be44c1cac1e9bce8242f443c54c7405223d616cd">Color::Black</a>);</div>
<div class="line">    cv.clear();</div>
<div class="line">    cv.setPenColor(<a id="a7" name="a7"></a><a class="code hl_enumvalue" href="group___enumerations_gab87bacfdad76e61b9412d7124be44c1c.html#ggab87bacfdad76e61b9412d7124be44c1cab548046646b36c12aa6ba841de500094">Color::White</a>);</div>
<div class="line">    cv.setBrushColor(<a class="code hl_enumvalue" href="group___enumerations_gab87bacfdad76e61b9412d7124be44c1c.html#ggab87bacfdad76e61b9412d7124be44c1cab548046646b36c12aa6ba841de500094">Color::White</a>);</div>
<div class="line">    <span class="comment">// stars</span></div>
<div class="line">    cv.setPenColor(255, 255, 255);</div>
<div class="line">    <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; 50; ++i)</div>
<div class="line">      cv.setPixel(random(getWidth()), random(getHeight()));</div>
<div class="line">    <span class="comment">// galaxy</span></div>
<div class="line">    cv.drawBitmap(5, 5, &amp;galaxy);</div>
<div class="line">    cv.drawBitmap(90, 35, &amp;galaxy);</div>
<div class="line">  }</div>
<div class="line"> </div>
<div class="line">};</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">void</span> setup()</div>
<div class="line">{</div>
<div class="line">  <span class="comment">// just for debug</span></div>
<div class="line">  Serial.begin(115200);</div>
<div class="line"> </div>
<div class="line">  <a class="code hl_enumvalue" href="group___enumerations_ga1e46218ee302fcc8c77e4ea0968ea149.html#gga1e46218ee302fcc8c77e4ea0968ea149afb87bf1fc88386ca21395991f90fff95">I2C</a>.begin(OLED_SDA, OLED_SCL);</div>
<div class="line"> </div>
<div class="line">  DisplayController.<a id="a8" name="a8"></a><a class="code hl_function" href="classfabgl_1_1_s_s_d1306_controller_af4457c33ec3247fb92c8bf2a2d8e9819.html#af4457c33ec3247fb92c8bf2a2d8e9819">begin</a>(&amp;I2C, OLED_ADDR, OLED_RESET);</div>
<div class="line">  DisplayController.<a id="a9" name="a9"></a><a class="code hl_function" href="classfabgl_1_1_s_s_d1306_controller_a2ac60f74ade23bfba42ef0985635589d.html#a2ac60f74ade23bfba42ef0985635589d">setResolution</a>(<a id="a10" name="a10"></a><a class="code hl_define" href="fabglconf_8h_a48a7b2c95a1f0546c72310844fa6fc74.html#a48a7b2c95a1f0546c72310844fa6fc74">OLED_128x64</a>);</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">while</span> (DisplayController.<a id="a11" name="a11"></a><a class="code hl_function" href="classfabgl_1_1_s_s_d1306_controller_a4a47f12debf6d5d7273c3e5fb360417a.html#a4a47f12debf6d5d7273c3e5fb360417a">available</a>() == <span class="keyword">false</span>) {</div>
<div class="line">    Serial.write(<span class="stringliteral">&quot;Error, SSD1306 not available!\n&quot;</span>);</div>
<div class="line">    delay(5000);</div>
<div class="line">  }</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">void</span> loop()</div>
<div class="line">{</div>
<div class="line">  MyScene scene;</div>
<div class="line">  scene.start();</div>
<div class="line">  vTaskSuspend(<span class="keyword">nullptr</span>);</div>
<div class="line">}</div>
<div class="ttc" id="aclassfabgl_1_1_base_display_controller_a5308b6853d3778845649f08832e96535_html_a5308b6853d3778845649f08832e96535"><div class="ttname"><a href="classfabgl_1_1_base_display_controller_a5308b6853d3778845649f08832e96535.html#a5308b6853d3778845649f08832e96535">fabgl::BaseDisplayController::getViewPortHeight</a></div><div class="ttdeci">int getViewPortHeight()</div><div class="ttdoc">Determines vertical size of the viewport.</div><div class="ttdef"><b>Definition:</b> <a href="displaycontroller_8h_source.html#l00710">displaycontroller.h:710</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_base_display_controller_a69dd55b31e9c284aeec6f2b91a8da525_html_a69dd55b31e9c284aeec6f2b91a8da525"><div class="ttname"><a href="classfabgl_1_1_base_display_controller_a69dd55b31e9c284aeec6f2b91a8da525.html#a69dd55b31e9c284aeec6f2b91a8da525">fabgl::BaseDisplayController::getViewPortWidth</a></div><div class="ttdeci">int getViewPortWidth()</div><div class="ttdoc">Determines horizontal size of the viewport.</div><div class="ttdef"><b>Definition:</b> <a href="displaycontroller_8h_source.html#l00703">displaycontroller.h:703</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_bitmapped_display_controller_a75ba732cc6ae90f53757b588f6c75d7e_html_a75ba732cc6ae90f53757b588f6c75d7e"><div class="ttname"><a href="classfabgl_1_1_bitmapped_display_controller_a75ba732cc6ae90f53757b588f6c75d7e.html#a75ba732cc6ae90f53757b588f6c75d7e">fabgl::BitmappedDisplayController::setSprites</a></div><div class="ttdeci">void setSprites(T *sprites, int count)</div><div class="ttdoc">Sets the list of active sprites.</div><div class="ttdef"><b>Definition:</b> <a href="displaycontroller_8h_source.html#l00846">displaycontroller.h:846</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_bitmapped_display_controller_aeb689cfc2364a4d66e3ac3368146c70d_html_aeb689cfc2364a4d66e3ac3368146c70d"><div class="ttname"><a href="classfabgl_1_1_bitmapped_display_controller_aeb689cfc2364a4d66e3ac3368146c70d.html#aeb689cfc2364a4d66e3ac3368146c70d">fabgl::BitmappedDisplayController::refreshSprites</a></div><div class="ttdeci">void refreshSprites()</div><div class="ttdoc">Forces the sprites to be updated.</div><div class="ttdef"><b>Definition:</b> <a href="displaycontroller_8cpp_source.html#l00583">displaycontroller.cpp:583</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_i2_c_html"><div class="ttname"><a href="classfabgl_1_1_i2_c.html">fabgl::I2C</a></div><div class="ttdoc">I2C class allows multiple tasks to communicate with I2C devices, serializing read/write jobs.</div><div class="ttdef"><b>Definition:</b> <a href="tsi2c_8h_source.html#l00094">tsi2c.h:94</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_s_s_d1306_controller_a2ac60f74ade23bfba42ef0985635589d_html_a2ac60f74ade23bfba42ef0985635589d"><div class="ttname"><a href="classfabgl_1_1_s_s_d1306_controller_a2ac60f74ade23bfba42ef0985635589d.html#a2ac60f74ade23bfba42ef0985635589d">fabgl::SSD1306Controller::setResolution</a></div><div class="ttdeci">void setResolution(char const *modeline, int viewPortWidth=-1, int viewPortHeight=-1, bool doubleBuffered=false)</div><div class="ttdoc">Sets SSD1306 resolution and viewport size.</div><div class="ttdef"><b>Definition:</b> <a href="_s_s_d1306_controller_8cpp_source.html#l00166">SSD1306Controller.cpp:166</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_s_s_d1306_controller_a4a47f12debf6d5d7273c3e5fb360417a_html_a4a47f12debf6d5d7273c3e5fb360417a"><div class="ttname"><a href="classfabgl_1_1_s_s_d1306_controller_a4a47f12debf6d5d7273c3e5fb360417a.html#a4a47f12debf6d5d7273c3e5fb360417a">fabgl::SSD1306Controller::available</a></div><div class="ttdeci">bool available()</div><div class="ttdoc">Checks the SSD1306 device availability.</div><div class="ttdef"><b>Definition:</b> <a href="_s_s_d1306_controller_8h_source.html#l00144">SSD1306Controller.h:144</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_s_s_d1306_controller_af4457c33ec3247fb92c8bf2a2d8e9819_html_af4457c33ec3247fb92c8bf2a2d8e9819"><div class="ttname"><a href="classfabgl_1_1_s_s_d1306_controller_af4457c33ec3247fb92c8bf2a2d8e9819.html#af4457c33ec3247fb92c8bf2a2d8e9819">fabgl::SSD1306Controller::begin</a></div><div class="ttdeci">void begin(I2C *i2c, int address=0x3C, gpio_num_t resetGPIO=GPIO_UNUSED)</div><div class="ttdoc">Initializes SSD1306 assigning I2C bus, reset pin and address.</div><div class="ttdef"><b>Definition:</b> <a href="_s_s_d1306_controller_8cpp_source.html#l00138">SSD1306Controller.cpp:138</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_s_s_d1306_controller_html"><div class="ttname"><a href="classfabgl_1_1_s_s_d1306_controller.html">fabgl::SSD1306Controller</a></div><div class="ttdoc">Display driver for SSD1306 based OLED display, with I2C connection.</div><div class="ttdef"><b>Definition:</b> <a href="_s_s_d1306_controller_8h_source.html#l00092">SSD1306Controller.h:92</a></div></div>
<div class="ttc" id="afabgl_8h_html"><div class="ttname"><a href="fabgl_8h.html">fabgl.h</a></div><div class="ttdoc">This file is the all in one include file. Application can just include this file to use FabGL library...</div></div>
<div class="ttc" id="afabglconf_8h_a48a7b2c95a1f0546c72310844fa6fc74_html_a48a7b2c95a1f0546c72310844fa6fc74"><div class="ttname"><a href="fabglconf_8h_a48a7b2c95a1f0546c72310844fa6fc74.html#a48a7b2c95a1f0546c72310844fa6fc74">OLED_128x64</a></div><div class="ttdeci">#define OLED_128x64</div><div class="ttdef"><b>Definition:</b> <a href="fabglconf_8h_source.html#l00329">fabglconf.h:329</a></div></div>
<div class="ttc" id="agroup___enumerations_ga1e46218ee302fcc8c77e4ea0968ea149_html_gga1e46218ee302fcc8c77e4ea0968ea149afb87bf1fc88386ca21395991f90fff95"><div class="ttname"><a href="group___enumerations_ga1e46218ee302fcc8c77e4ea0968ea149.html#gga1e46218ee302fcc8c77e4ea0968ea149afb87bf1fc88386ca21395991f90fff95">fabgl::VideoMode::I2C</a></div><div class="ttdeci">@ I2C</div></div>
<div class="ttc" id="agroup___enumerations_gab87bacfdad76e61b9412d7124be44c1c_html_ggab87bacfdad76e61b9412d7124be44c1cab548046646b36c12aa6ba841de500094"><div class="ttname"><a href="group___enumerations_gab87bacfdad76e61b9412d7124be44c1c.html#ggab87bacfdad76e61b9412d7124be44c1cab548046646b36c12aa6ba841de500094">fabgl::White</a></div><div class="ttdeci">@ White</div><div class="ttdef"><b>Definition:</b> <a href="displaycontroller_8h_source.html#l00210">displaycontroller.h:210</a></div></div>
<div class="ttc" id="agroup___enumerations_gab87bacfdad76e61b9412d7124be44c1c_html_ggab87bacfdad76e61b9412d7124be44c1cac1e9bce8242f443c54c7405223d616cd"><div class="ttname"><a href="group___enumerations_gab87bacfdad76e61b9412d7124be44c1c.html#ggab87bacfdad76e61b9412d7124be44c1cac1e9bce8242f443c54c7405223d616cd">fabgl::Black</a></div><div class="ttdeci">@ Black</div><div class="ttdef"><b>Definition:</b> <a href="displaycontroller_8h_source.html#l00203">displaycontroller.h:203</a></div></div>
</div><!-- fragment --> </div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated on Mon Aug 29 2022 13:52:04 for FabGL by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 </li>
  </ul>
</div>
</body>
</html>
